export const tranStr=(name,payload)=>{
    if(typeof(payload) == 'object'){
        payload = JSON.stringify(payload)
    }
    sessionStorage.setItem(name,payload)
}

export const tranObj = (name)=>{
    let token = sessionStorage.getItem(name)
    try{
         token = JSON.parse(token)
         return token
    }catch{
        return token
    }
}

export const removeInfo = (state ,name)=>{
    sessionStorage.removeItem(name)
    state[name] = null

}